﻿using Microsoft.EntityFrameworkCore.Migrations;

namespace Base.Data.Migrations
{
    public partial class add_api_key : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "api_key",
                table: "t_user",
                type: "character varying(80)",
                maxLength: 80,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "api_key",
                table: "t_organization",
                type: "character varying(80)",
                maxLength: 80,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "api_key",
                table: "t_member",
                type: "character varying(80)",
                maxLength: 80,
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "api_key",
                table: "t_department",
                type: "character varying(80)",
                maxLength: 80,
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_t_user_post_create_time",
                table: "t_user_post",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_user_create_time",
                table: "t_user",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_role_group_auth_role_create_time",
                table: "t_role_group_auth_role",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_role_group_create_time",
                table: "t_role_group",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_role_auth_info_create_time",
                table: "t_role_auth_info",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_role_auth_form_field_create_time",
                table: "t_role_auth_form_field",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_role_auth_form_btn_create_time",
                table: "t_role_auth_form_btn",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_role_auth_form_create_time",
                table: "t_role_auth_form",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_role_create_time",
                table: "t_role",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_organization_create_time",
                table: "t_organization",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_notice_create_time",
                table: "t_notice",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_menu_create_time",
                table: "t_menu",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_member_auth_role_group_create_time",
                table: "t_member_auth_role_group",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_member_auth_role_create_time",
                table: "t_member_auth_role",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_member_create_time",
                table: "t_member",
                column: "create_time");

            migrationBuilder.CreateIndex(
                name: "IX_t_department_create_time",
                table: "t_department",
                column: "create_time");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_t_user_post_create_time",
                table: "t_user_post");

            migrationBuilder.DropIndex(
                name: "IX_t_user_create_time",
                table: "t_user");

            migrationBuilder.DropIndex(
                name: "IX_t_role_group_auth_role_create_time",
                table: "t_role_group_auth_role");

            migrationBuilder.DropIndex(
                name: "IX_t_role_group_create_time",
                table: "t_role_group");

            migrationBuilder.DropIndex(
                name: "IX_t_role_auth_info_create_time",
                table: "t_role_auth_info");

            migrationBuilder.DropIndex(
                name: "IX_t_role_auth_form_field_create_time",
                table: "t_role_auth_form_field");

            migrationBuilder.DropIndex(
                name: "IX_t_role_auth_form_btn_create_time",
                table: "t_role_auth_form_btn");

            migrationBuilder.DropIndex(
                name: "IX_t_role_auth_form_create_time",
                table: "t_role_auth_form");

            migrationBuilder.DropIndex(
                name: "IX_t_role_create_time",
                table: "t_role");

            migrationBuilder.DropIndex(
                name: "IX_t_organization_create_time",
                table: "t_organization");

            migrationBuilder.DropIndex(
                name: "IX_t_notice_create_time",
                table: "t_notice");

            migrationBuilder.DropIndex(
                name: "IX_t_menu_create_time",
                table: "t_menu");

            migrationBuilder.DropIndex(
                name: "IX_t_member_auth_role_group_create_time",
                table: "t_member_auth_role_group");

            migrationBuilder.DropIndex(
                name: "IX_t_member_auth_role_create_time",
                table: "t_member_auth_role");

            migrationBuilder.DropIndex(
                name: "IX_t_member_create_time",
                table: "t_member");

            migrationBuilder.DropIndex(
                name: "IX_t_department_create_time",
                table: "t_department");

            migrationBuilder.DropColumn(
                name: "api_key",
                table: "t_user");

            migrationBuilder.DropColumn(
                name: "api_key",
                table: "t_organization");

            migrationBuilder.DropColumn(
                name: "api_key",
                table: "t_member");

            migrationBuilder.DropColumn(
                name: "api_key",
                table: "t_department");
        }
    }
}
